# gabriel-template

a template for web apps

specifically it assumes a build chain rooted in using cli components and npm build scripts in `package.json`. cli components like:
  - babel-cli so you can write js with that es6 sugar
  - pug-cli so you can write pug instead of html
  - js-yaml so you can write values for your templates in yaml
  - node-sass so you can write css with those sass goodies
  - cssmin and uglifyjs because you have good will for your users

client-side, it provides the following components by default:
  - pouchdb, if you ever need a database in the browser
  - marked, for converting markdown
  - pug runtime, for inserting pre-compiled pug templates into the dom
  - jquery, for dom manipulation
  - director, for routing

this template focuses on using a sophisticated build process to optimize the package clients receive, but encapsulating app logic in code executed largely on the client. pouchdb can be used with a couchdb server to facilitate sophisticated, secure communication -- theoretically.

## install and use

like this, in your terminal:

  git clone git@notabug.org:garbados/gabriel-template.git
  cp -r gabriel-template your-new-project
  cd your-new-project
  npm install

you can run `npm start` to build the static site and run a server exposing the site at `http://localhost:3000`.

to customize things, look here:
  - `text.yaml` to configure values for text labels
  - `app` all app-related code, including scripts, stylesheets, and templates
  - `app/scripts/index.es` contains the js/es that gets compiled with dependencies and sent to the client
  - `app/client-templates` get sent to the client as `[name]Template` so `about.pug` becomes `aboutTemplate`
  - `app/server-templates` contains the elements required in building the `index.html` that backs the rest of the apps functionality

watch out for the magic:
- since the build process converts all client-side templates into global objects, you'll need to define them at the top of any file where they're used in order to pass eslint
- pouchdb stores data in the client's browser, which can't be expected to have much available space. use it sparingly

## license

see `license.txt` before using. especially you, corpers.
